error_log /var/log/nginx.error.log info;
pid /run/nginx.pid;

worker_processes auto;
worker_cpu_affinity auto;

pcre_jit on;

events {
  worker_connections #worker_connections#;
  multi_accept on;
  use epoll;
}

http {
  include /env/share/nginx/conf/mime.types;
  default_type application/octet-stream;

  access_log /var/log/nginx.access.log combined;

  sendfile on;
  tcp_nopush on;

  keepalive_timeout 60;

  charset utf-8;
  server_tokens off;

  server {
    listen 8000;
    server_name localhost;

    root #public_path#;
    index index.php;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location ~ /\. {
        deny all;
    }

    # WordPress only
    location ~* /(?:uploads|files)/.*\.php$ {
        deny all;
    }

    location / {
      try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
      include /env/share/nginx/conf/fastcgi_params;
      fastcgi_intercept_errors on;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_pass unix:/run/php-fpm.sock;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
      expires max;
      log_not_found off;
    }
  }
}
